<template>
  <div class="pivottable">
    数据透视表￥1000（定制化+￥500）
    <div ref="pivot"/>
  </div>
</template>
<script>

export default {
  mounted() {
    this.initPivotUI()
  },
  methods: {
    initPivotUI() {
      const dom = this.$refs.pivot
      $(dom).pivotUI(
        [
          { color: 'blue', shape: 'circle', attr1: '1', attr2: 2 },
          { color: 'red', shape: 'triangle', attr1: '1', attr2: 2 }
        ],
        {
          rows: ['color'],
          cols: ['shape'],
          aggregator: 'Sum'
        }
      )
    }
  }
}
</script>
<style lang="less" scoped>
.pivottable{
    padding: 10px;
}
</style>
